<template>
  <div>
    <br />
    <div align="center">
      <h3>绑定手机号</h3>
    </div>
    <!-- ======== -->
    <div>
      <van-cell-group inset>
        <van-field
          v-model="mobile"
          rows="1"
          autosize
          label="手机号"
          type="textarea"
          placeholder="请输入手机号"
        />
      </van-cell-group>
    </div>
    <br />
    <!-- ======== -->
    <div align="center">
      <van-button @click="bind" round type="primary" class="button_index"
        >绑定</van-button
      >
    </div>
    <!-- ======== -->
    <div></div>
    <!-- ======== -->
    <div></div>
    <!-- ======== -->
    <div></div>
    <!-- ======== -->
    <div></div>
    <!-- ======== -->
    <div></div>
    <!-- ======== -->
    <div></div>
    <!-- ======== -->
    <div></div>
    <!-- ======== -->
    <div></div>
    <!-- ======== -->
    <div></div>
    <!-- ======== -->
    <div></div>
    <!-- ======== -->
    <div></div>
    <!-- ======== -->
  </div>
</template>

<script>
export default {
  name: "",
  data() {
    return {
      mobile: "13111111111",
    };
  },
  props: {},

  components: {},

  created() {},

  mounted() {},

  methods: {
    bind() {
      this.axios.post("/bindMobile", {
        token: this.$route.query.token,
        uid: this.$route.query.uid,
        mobile: this.mobile,
      }).then(res =>{
        console.log("绑定手机号的响应：", res)
        this.$message({
              type: "success",
              message: res.data.msg,
            });
        localStorage.setItem("token", res.data.token);
        this.$router.push("/");
      });
    },
  },

  computed: {},

  watch: {},

  directives: {},

  filters: {},
};
</script>

<style scoped>
* {
  margin: 0;
}
.button_index {
  width: 90%;
}
</style>
